<template>
	<view class="mykehu p20">
		<myNav>
			<view slot="left" @click="back"><uni-icons type="closeempty" color="#fff"></uni-icons></view>
			<view class="center">查看楼栋</view>
		</myNav>
		<view class="tab">
			<view class="tab-item">
				<image src="../../static/all/chakanloudong/yi.png" mode=""></image>
				<text>已售(326)</text>
			</view>
			<view class="tab-item">
				<image src="../../static/all/chakanloudong/dai.png" mode=""></image>
				<text>待售(326)</text>
			</view>
			<view class="tab-item">
				<image src="../../static/all/chakanloudong/yuyue.png" mode=""></image>
				<text>预约(0)</text>
			</view>
		</view>
		<template v-for="(item, index) in 2">
			<view class="">
				<view class="tab-xxx">测试项目-一期</view>
				<view class="mxxx">
					<view class="border-xxx" @click="goto(item)" v-for="(item, index) in 4" :key="index">
						<text>9栋</text>
						<view>
							<view class="jindu">15/45</view>
							<view class="jindutiao">
								<view
									class="state"
									:style="{
										maxWidth: (15 / 45) * 132 + 'px'
									}"
								></view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</template>
	</view>
</template>

<script>
import { mapMutations } from 'vuex';
import darkCalendar from '@/components/dark-calendar/dark-calendar';
import myNav from '../../components/mynav/mynav.vue';
import { searchedVistor } from '@/api/index.js';
import { MyShow } from '@/util/my.js';
export default {
	components: { myNav, darkCalendar },
	data() {
		return {
			para: ''
		};
	},
	methods: {
		back(){
			uni.switchTab({
				url:"../my/my"
			})
		},
		async searchedVistor() {
			//去请求接口
			//  todo 字段自己填充吧
			// console.log('去请求接口');
			try {
				let reslut = await searchedVistor({
					para: this.para
				});
				//成功
				new MyShow('需要渲染的字段').tixing();
			} catch (e) {
				//TODO handle the exception
				new MyShow('需要渲染的字段').tixing();
			}
		},
		gotoinfo(val) {
			uni.navigateTo({
				url: './p11'
			});
		},
		goto(val) {
			uni.navigateTo({
				url:"./p21?id="+val.id
			})
		}
	}
};
</script>

<style lang="scss">
@import './main.scss';
.myright {
	display: flex;
	flex-direction: column;
	image {
		width: 20px;
		height: 20px;
	}
	margin-top: 40px;
	align-items: center;
	color: #ffffff;
	text {
		margin-top: 5px;
	}
}
</style>
